<!DOCTYPE html>
<html>
<head>
    <title>复制测试</title>
</head>
<body>
    <h1>复制功能测试</h1>
    <button onclick="testCopy()">点击测试复制</button>
    <p id="result"></p>

    <script>
        function testCopy() {
            const testUrl = "https://example.com/test.jpg";
            console.log('测试复制:', testUrl);
            
            // 直接使用最简单的方法
            const textArea = document.createElement('textarea');
            textArea.value = testUrl;
            document.body.appendChild(textArea);
            textArea.select();
            
            try {
                const success = document.execCommand('copy');
                document.getElementById('result').innerHTML = success ? 
                    '<span style="color: green;">✅ 复制成功！</span>' : 
                    '<span style="color: red;">❌ 复制失败</span>';
            } catch (e) {
                document.getElementById('result').innerHTML = '<span style="color: red;">❌ 复制异常: ' + e.message + '</span>';
            }
            
            document.body.removeChild(textArea);
        }
    </script>
</body>
</html>